package com.snack.controller;

import com.snack.common.result.Result;
import com.snack.entity.pojo.Batch;
import com.snack.service.BatchService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * @author huangfuhao
 * @Date 2025/3/28
 */
@RestController
@RequestMapping("/api/Batch")
public class BatchController {

    @Resource
    private BatchService batchService;

    //新增零食进货批次
    @PostMapping("/addBatch")
    public Result addBatch(@RequestBody Batch batch){
        return batchService.addBatch(batch);
    }

    //查看本店铺进货批次
    @PostMapping("/listBatch")
    public Result listBatch(@RequestBody Batch batch){
        return batchService.listBatch(batch);
    }

    //删除该零食进货批次
    @PostMapping("/deleteBatch")
    public Result deleteBatch(@RequestBody Batch batch){
        return batchService.deleteBatch(batch);
    }

       // 更新批次信息
   @PutMapping("/updateBatch")
   public Result updateBatch(@RequestBody Batch batch) {
       return batchService.updateBatch(batch);
   }

}